bug: expose agent_framework and labels in ReasoningEngine.create#6268
bug: expose agent_framework and labels in ReasoningEngine.create#6268FreddyAyala wants to merge 3 commits intogoogleapis:mainfrom
Conversation
yeesian
left a comment
There was a problem hiding this comment.
Thank you for this! Just out of curiosity, is there a reason you prefer to use ReasoningEngine.create() over the client-based SDK? https://docs.cloud.google.com/agent-builder/agent-engine/overview#migration
|
Hi @yeesian , thanks for the review and for pointing out the migration path! Regarding ReasoningEngine.create() vs the client-based SDK: I researched the Agent Engine Migration Guide and I agree that client.agent_engines.create() is the correct long-term direction, especially since it natively supports labels, env_vars, and agent_framework. However, I cannot use it yet. I am on the latest public release of the SDK (v1.133.0, released Jan 8, 2026), and the agent_engines module is not importable: import vertexai This fails with AttributeError on v1.133.0client = vertexai.init(project="...", location="...") Why this PR is still needed: We need to unblock ADK users and Telemetry today. Since the "New Way" isn't available in the public distribution, users are forced to use ReasoningEngine. Without this PR, they have no way to set tags or telemetry without dropping down to the complex GAPIC client or using brittle post-creation patching scripts. Proposal: Can we merge this to support the current public interface? We can mark ReasoningEngine as deprecated once agent_engines is fully exposed in a future release. (I will also address the lint/test failures in a follow-up commit). |
Fixes #6267
Description
This PR updates
ReasoningEngine.create(and _prepare) to acceptagent_framework,labels, andenv_vars. These parameters are passed down to the underlying ReasoningEngine resource creation.Motivation
Currently, deploying an ADK-based agent (
google-adk) via the Python SDK results in an agent that is missing critical metadata in the Vertex AI Console. Specifically:goog-vertex-reasoning-engine-framework: adklabel.OTEL_...environment variables into the deployment spec.without this metadata, the "Traces", "Sessions", and "Dashboards" tabs in the Vertex AI Console are disabled. This change allows users to set these values directly during creation, enabling full Console feature parity with Terraform deployments.
Changes
ReasoningEngine.create()signature to includeagent_framework,labels, andenv_vars._reasoning_engines._prepareto propagate these values.env_varsare correctly converted toaip_types.EnvVarprotos.tests/unit/vertex_langchain/test_reasoning_engines.pyto verify parameter passing.